Skip to content

M4: Bumblebee Qwen3 end-to-end on Emily.Backend - #11

Merged
ausimian merged 1 commit into
mainfrom
feat/m4-qwen3
Apr 14, 2026
Merged

M4: Bumblebee Qwen3 end-to-end on Emily.Backend#11
ausimian merged 1 commit into
mainfrom
feat/m4-qwen3

Conversation

@ausimian

Copy link
Copy Markdown
Owner

Summary

  • Qwen/Qwen3-0.6B greedy-decodes end-to-end through Bumblebee's causal-LM serving — every Nx op on Qwen3's critical path (QK-norm, rotary, GQA, SwiGLU, RMSNorm, tied embeddings, KV-cache put_slice in a defn while loop) runs correctly.
  • Native put_slice/4 over mx::slice_update replaces the BinaryBackend fallback on the autoregressive hot path; fixes a latent dynamic-start-indices crash and an Nx-type-promotion bug (MLX buffer dtype silently disagreed with Nx's shape metadata).
  • Conformance suite: three Qwen3 architectures (:base, :for_causal_language_modeling, :for_sequence_classification) ported verbatim from Bumblebee's own tests, plus a greedy-decode smoke test pinned to a 16-token checked-in reference.
  • Opt-in mix test --only qwen3_full runs a full Qwen3-0.6B test (~1.5 GB checkpoint); default --only conformance stays weights-light.
  • bench/qwen3_tokens_per_sec.exs — standalone throughput harness. Dev-host baseline: ~13.8 tok/s at 16 new tokens under Nx.Defn.Evaluator (pre-mlx::core::compile, which lands in M6).
  • Bumblebee pinned to a main SHA (273805e9…) because Qwen3 isn't in any Hex release yet.

Test plan

  • mix precommit (163 tests + 56 properties, 0 failures, credo --strict clean)
  • mix test --only conformance (11 tests, 0 failures — DistilBERT + Qwen3 tiny-random + greedy smoke)
  • mix test --only qwen3_full (1 test, 0 failures — real Qwen3-0.6B)
  • MIX_ENV=test mix run bench/qwen3_tokens_per_sec.exs (end-to-end generation on Qwen3-0.6B)

Qwen/Qwen3-0.6B greedy-decodes end-to-end through Bumblebee's causal-LM
serving. Every Nx op on Qwen3's critical path — QK-norm, rotary
embeddings, GQA, SwiGLU FFN, RMSNorm, tied embeddings, KV-cache
put_slice in a defn while loop — runs correctly.

Native put_slice/4 over MLX slice_update replaces the BinaryBackend
round-trip on the autoregressive hot path, and fixes a latent dynamic
start-indices crash plus an Nx-promotion bug where the MLX buffer dtype
silently disagreed with Nx's shape metadata.

Adds a ported-from-Bumblebee conformance test for the three Qwen3
architectures plus a greedy-decode smoke test against a 16-token
checked-in reference, an opt-in full Qwen3-0.6B test (~1.5 GB
checkpoint) gated behind :qwen3_full, and a standalone tokens/sec
benchmark harness. Bumblebee is pinned to a main SHA until Qwen3 ships
on Hex.
@ausimian
ausimian merged commit d340412 into main Apr 14, 2026
1 check passed
@ausimian
ausimian deleted the feat/m4-qwen3 branch April 14, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant